﻿using System.ComponentModel;

namespace SqlSugarWebApi.Quartz
{
    public class QuartzJobSchedule
    {
        public QuartzJobSchedule(Type jobType, string cronExpression, DateTime startTime, DateTime endTime)
        {
            this.JobType = jobType ?? throw new ArgumentNullException(nameof(jobType));
            this.CronExpression = cronExpression ?? throw new ArgumentNullException(cronExpression);
            this.StartTime = startTime;
            this.EndTime = endTime;
        }
        public DateTime StartTime { get; private set; }

        public DateTime EndTime { get; private set; }

        public Type JobType { get; private set; }

        public string CronExpression { get; private set; }

        public JobStatus JobStatu { get; set; } = JobStatus.Init;
    }

    public enum JobStatus : byte
    {
        [Description("Initialization")]
        Init = 0,
        [Description("Running")]
        Running = 1,
        [Description("Scheduling")]
        Scheduling = 2,
        [Description("Stopped")]
        Stopped = 3,
    }
}
